package com.threeonemeeting.listcache;

import android.graphics.Bitmap;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.threeonemeeting.R;

public class MeetingCommentInfoCache {
	private View baseView;

	private int nMeetingId;
	private Bitmap bitmapHeader; // 头像
	private String strCommentName;
	private String strCommentTime;
	private String strCommentMsg;
	private String strRepliedCommentName;
	private String strRepliedCommentTime;
	private String strRepliedCommentMsg;
	private boolean bHaveImage;
	private int nRepliedNum;

	private ImageView commentHeaderImageView;
	private TextView commentNameTextView;
	private TextView commentTimeTextView;
	private TextView commentTextTextView;
	private TextView repliedCommentNameTextView;
	private TextView repliedCommentTimeTextView;
	private TextView repliedCommentMsgTextView;
	private ImageView imgView;
	private TextView repliedCommentNumTextView;

	private LinearLayout repliedLayout; // 回复区域

	public MeetingCommentInfoCache(View baseView, int nMeetingId,
			Bitmap bitmapHeader, String strCommentName, String strCommentTime,
			String strCommentMsg) {
		this.baseView = baseView;
		this.nMeetingId = nMeetingId;
		this.bitmapHeader = bitmapHeader;
		this.strCommentName = strCommentName;
		this.strCommentTime = strCommentTime;
		this.strCommentMsg = strCommentMsg;
	}

	public int getMeetingId() {
		return this.nMeetingId;
	}

	public Bitmap getHeaderBitmap() {
		return this.bitmapHeader;
	}

	public void setHeaderBitmap(Bitmap bm) {
		this.bitmapHeader = bm;
	}

	public String getCommentName() {
		return this.strCommentName;
	}

	public String getCommentTime() {
		return this.strCommentTime;
	}

	public String getCommentMsg() {
		return this.strCommentMsg;
	}

	public void setRepliedCommentName(String strRepliedCommentName) {
		this.strRepliedCommentName = strRepliedCommentName;
	}

	public void setRepliedCommentTime(String strRepliedCommentTime) {
		this.strRepliedCommentTime = strRepliedCommentTime;
	}

	public void setRepliedCommentMsg(String strRepliedCommentMsg) {
		this.strRepliedCommentMsg = strRepliedCommentMsg;
	}

	public void setHasCommentImage(boolean bHasImage) {
		this.bHaveImage = bHasImage;
	}

	public boolean isHasCommentImage() {
		return this.bHaveImage;
	}

	public void setRepliedNum(int nNum) {
		this.nRepliedNum = nNum;
	}

	public int getRepliedNum() {
		return this.nRepliedNum;
	}

	public String getRepliedCommentName() {
		return this.strRepliedCommentName;
	}

	public String getRepliedCommentTime() {
		return this.strRepliedCommentTime;
	}

	public String getRepliedCommentMsg() {
		return this.strRepliedCommentMsg;
	}

	public ImageView getCommentHeaderImageView() {
		if (commentHeaderImageView == null) {
			commentHeaderImageView = (ImageView) baseView
					.findViewById(R.id.comment_header);
		}

		return commentHeaderImageView;
	}

	public TextView getCommentNameTextView() {
		if (commentNameTextView == null) {
			commentNameTextView = (TextView) baseView
					.findViewById(R.id.comment_name);
		}
		return commentNameTextView;
	}

	public TextView getCommentTimeTextView() {
		if (commentTimeTextView == null) {
			commentTimeTextView = (TextView) baseView
					.findViewById(R.id.comment_time);
		}
		return commentTimeTextView;
	}

	public TextView getCommentMsgTextView() {
		if (commentTextTextView == null) {
			commentTextTextView = (TextView) baseView
					.findViewById(R.id.comment_text);
		}
		return commentTextTextView;
	}

	public LinearLayout getRepliedLayout() {
		if (repliedLayout == null) {
			repliedLayout = (LinearLayout) baseView
					.findViewById(R.id.reply_layout);
		}

		return repliedLayout;
	}

	public TextView getRepliedCommentNameTextView() {
		if (repliedCommentNameTextView == null) {
			repliedCommentNameTextView = (TextView) baseView
					.findViewById(R.id.replied_comment_name);
		}
		return repliedCommentNameTextView;
	}

	public TextView getRepliedCommentTimeTextView() {
		if (repliedCommentTimeTextView == null) {
			repliedCommentTimeTextView = (TextView) baseView
					.findViewById(R.id.replied_comment_time);
		}
		return repliedCommentTimeTextView;
	}

	public TextView getRepliedCommentMsgTextView() {
		if (repliedCommentMsgTextView == null) {
			repliedCommentMsgTextView = (TextView) baseView
					.findViewById(R.id.replied_comment_text);
		}
		return repliedCommentMsgTextView;
	}

	public ImageView getImageView() {
		if (imgView == null) {
			imgView = (ImageView) baseView.findViewById(R.id.haveimg);
		}
		return imgView;
	}

	public TextView getRepliedNumTextView() {
		if (repliedCommentNumTextView == null) {
			repliedCommentNumTextView = (TextView) baseView
					.findViewById(R.id.reply_num);
		}
		return repliedCommentNumTextView;
	}
}
